% 一个简单的绘制氢原子Rnl(r)的程序
% 似乎在前几个示例中和G书是一致的...
% 没有归一化
% Gitee Repo

a = 0.2; %Bohr Radius
n = 2; %n = 1,2,3,...
l = 1; %l = 0,1,2,...,n-1

r = 0:0.01:10;
kappa = 1/(a*n);
rho = kappa * r;

R = ones(1,size(r,2));
c = zeros(1,n);

for j = 1:n-l-1;
  C = 2*(j+l-n)/(j*(j+2*l+1));
  if j == 1
    c(j) = C*1;
  else
    c(j) = C*c(j-1);
  endif
  R += c(j)*(rho.^j);
end
R = (1./r).*rho.^(l+1).*(e.^(-rho)).*R;

figure();
hold on
axis equal
line([0 10],[0 0],'color','k')
plot(r, R);

